package com.cavy.platform.server.validator;

import com.cavy.platform.server.domain.ContainerEnvironmentData;
import com.cavy.platform.server.domain.ContainerVolumeData;
import com.cavy.platform.server.dto.PluginPrimaryDto;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.List;

/**
 * @author 唐旭
 * @Date 2018/7/19
 */
public interface PluginContainerData {

    String getImage();


    String getCommand();


    String getUser();


    List<? extends ContainerVolumeData> getVolumes();


    List<? extends ContainerEnvironmentData> getEnvironments();


    String getWorkDir();


    PluginPrimaryDto getPlugin();

    @JsonIgnore
    default String getImageFieldName() {
        return "image";
    }

    @JsonIgnore
    default String getCommandFieldName() {
        return "command";
    }

    @JsonIgnore
    default String getUserFieldName() {
        return "user";
    }

    @JsonIgnore
    default String getVolumesFieldName() {
        return "volumes";
    }

    @JsonIgnore
    default String getEnvironmentsFieldName() {
        return "environments";
    }

    @JsonIgnore
    default String getWorkDirFieldName() {
        return "workDir";
    }
}
